package com.ruibang.glass.sale.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruibang.glass.sale.dto.FileInfoDTO;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 销售合同
 */
@Data
@TableName(value = "g_sale_contract_management")
@ApiModel(description = "销售合同")
public class GSaleContractManagement extends BaseEntity implements Serializable {

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;
    @ApiModelProperty(value = "编号")
    private String number;
    @ApiModelProperty(value = "合同编号")
    private String contractNumber;
    @ApiModelProperty(value = "合同名称")
    private String contractName;
    @ApiModelProperty(value = "签订单位")
    private String signatoryUnit;

    @ApiModelProperty(value = "签订单位客户信息Id")
    private String signatoryUnitId;

    @ApiModelProperty(value = "合同状态")
    private String contractStatus;
    @ApiModelProperty(value = "审批状态")
    private String approvalStatus;
    @ApiModelProperty(value = "合同类型")
    private String contractType;
    @ApiModelProperty(value = "订单数量")
    private BigDecimal orderQuantity;

    @ApiModelProperty(value = "订单使用数量")
    private BigDecimal orderUseQuantity;

    @ApiModelProperty(value = "已发货")
    private BigDecimal delivered;
    @ApiModelProperty(value = "待发货")
    private BigDecimal pendingDelivery;
    @ApiModelProperty(value = "完成率")
    private String completionRate;

    @ApiModelProperty(value = "签订日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime signDate;
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startDate;
    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endDate;
    @ApiModelProperty(value = "销售员")
    private String salesperson;
    @ApiModelProperty(value = "币种")
    private String currency;

    @ApiModelProperty(value = "老数据状态")
    private String oldStatus;

    @ApiModelProperty(value = "延期日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime overDate;

    @ApiModelProperty(value = "延期说明")
    private String overRemark;

    @ApiModelProperty(value = "创建人Id")
    private String createUserId;

    @TableField(exist = false)
    private List<String> ids;
    @TableField(exist = false)
    private List<GSaleContractProduct> gSaleContractProductList;
    @TableField(exist = false)
    private List<String> fileList;
    @TableField(exist = false)
    private List<String> removeIdList;
    @TableField(exist = false)
    List<FileInfoDTO> fileInfoDTOList;

    @TableField(exist = false)
    private List<String> zbFileList;

    @TableField(exist = false)
    List<FileInfoDTO> zbFileInfoDTOList;

    @TableField(exist = false)
    private List<String> removeZbIdList;


    @ApiModelProperty(value = "状态")
    @TableField(exist = false)
    private String status;

    @ApiModelProperty(value = "流程Id")
    @TableField(exist = false)
    private String processId;

    @ApiModelProperty(value = "审批状态")
    private String approveStatus;

    @ApiModelProperty(value = "审批节点")
    @TableField(exist = false)
    private String nodeName;

    @ApiModelProperty(value = "审批人")
    @TableField(exist = false)
    private String approveUser;

    @ApiModelProperty(value = "当前审批人Id")
    @TableField(exist = false)
    private String approveUserId;

    @ApiModelProperty(value = "菜单Id")
    @TableField(exist = false)
    private String menuId;


}
